package com.example.car.model

import com.example.car.api.CarApiServer
import com.example.car.entity.Car
import com.example.car.entity.GetPayCar
import com.example.car.entity.Pay
import com.example.car.entity.PayCar
import com.example.car.entity.PostCar
import com.example.common.view.model.BaseRepository
import com.example.common.view.model.BaseResultData
import okhttp3.RequestBody
import javax.inject.Inject

class CarRepository @Inject constructor(private val apiServer: CarApiServer):CarApiServer {
    override suspend fun getCar():BaseResultData<List<Car>>{
        return apiServer.getCar()
    }

    override suspend fun postCar(body: RequestBody): BaseResultData<PostCar> {
        return apiServer.postCar(body)
    }

    override suspend fun payCar(body: PayCar): BaseResultData<Pay> {
        return apiServer.payCar(body)
    }

    override suspend fun getPayCar(id: Int): BaseResultData<GetPayCar> {
        return apiServer.getPayCar(id)
    }
}